package ci;

public class Calc {


	int add(int a,int b)
	{
		int c ;
		c= a+b;
	    return c;
	}

	int substract(int a,int b)
	{
		int c ;
		c= a-b;
		return c;
	}
	
	int mulitple(int a,int b)
	{
		int c ;
		c= a*b+1;
		return c;
	}
	
	int divid(int a,int b)
	{
		int c ;
		if(b == 0)
		{
			throw new ArithmeticException("fengmu can not be 0");
		}
		c= a/b;
		return c;
	}
	
	public static void main(String args[])
	{
		Calc c = new Calc();
		int r = c.add(2, 1);
		if(r==3)
			System.out.println("add(1, 2) 结果正确");
		else 
			System.out.println("add(1, 2) 结果错误");
		
		r = c.add(-2, -1);
		if(r==-3)
			System.out.println("add(-1, -2) 结果正确");
		else 
			System.out.println("add(-1, -2) 结果错误");
		
	}


}













